var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]);
    })(e, t);
}, function(e, t) {
    function r() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, 
    new r());
}), a = this && this.__decorate || function(e, t, r, n) {
    var a, o = arguments.length, i = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, r) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(e, t, r, n); else for (var c = e.length - 1; 0 <= c; c--) (a = e[c]) && (i = (o < 3 ? a(i) : 3 < o ? a(t, r, i) : a(t, r)) || i);
    return 3 < o && i && Object.defineProperty(t, r, i), i;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("Global"), s = e("PopBackItemView"), c = e("LoadManager"), l = e("UIManager"), d = cc._decorator, u = d.ccclass, p = d.property, h = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.light = null, e.sprite = null, e.rankLabel = null, e.nameLabel = null, 
        e;
    }
    return i(e, t), e.prototype.init = function() {
        cc.tween(this.light).repeatForever(cc.tween().by(2, {
            angle: 60
        })).start(), PD.checkObjParam("item", "rank", "number") && (this.rankLabel.string = (PD.data.item.rank + 1).toString(), 
        this.nameLabel.string = r.G.getGunModel(PD.data.item.rank).m, c.default.getInstance().loadSpriteFrame({
            url: "image/arm2/" + r.G.getIdxByRank(PD.data.item.rank),
            sprite: this.sprite
        }));
    }, e.prototype.callback = function() {
        if (PD.checkObjParam("item", "rank", "number")) {
            var e = l.default.getInstance().getPnl("start");
            if (0 == e.boxs.filter(function(e) {
                return e.isEmpty();
            }).length) return void cc.log("栏位已满");
            e.appendEquip(PD.data.item.rank, 0);
        }
        this.closePnl();
    }, a([ p(cc.Node) ], e.prototype, "light", void 0), a([ p(cc.Sprite) ], e.prototype, "sprite", void 0), 
    a([ p(cc.Label) ], e.prototype, "rankLabel", void 0), a([ p(cc.Label) ], e.prototype, "nameLabel", void 0), 
    a([ u ], e);
}(s.default);

n.default = h;